<!--#include file="pjson.asp"-->
<!DOCTYPE html>
<html>
<head>
  <title>受试者管理</title>
<%
easp.include "h.asp"
' easp.db.exec("ALTER TABLE [测试1_12_1] ADD [cs] NVARCHAR (6) NULL")
%>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-card"><br>
        <div class="layui-form-item">
          <div class="layui-inline">
              <input type="text" name="tn" placeholder="" autocomplete="off" class="layui-input">            
          </div>
          <div class="layui-inline">
			  <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="u_search">
              <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
            </button>
			  <button type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="u_add">新增</button>			
          </div>
        </div>
      <div class="layui-card-body">
		<script type="text/html" id="barDemo">
			<a class="layui-btn layui-btn-xs" lay-event="t_show2">填表</a>
		</script>
		<table id="u" lay-filter="u"></table><br>
      </div>
    </div>
  </div>
  <script src="/dzps/src/layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '/dzps/src/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'useradmin', 'table'], function(){
    var $ = layui.$
    ,form = layui.form
    ,admin = layui.admin	
    ,table = layui.table;
    form.render();
	table.render({
        elem: '#u',
        url: layui.setter.base + 'lib/reg.asp?action=u_list',
        cols: [[
        {field: 'id',title: 'ID',width: 60,sort: true,hide:true},
        {field: 'bh',title: '编号',width: 100},	
        {field: 'un',title: '受试者名',width: 100},	
        {field: 'prn',title: '所属项目',width: 100,hide:true},		
        {field: 'prj_id',title: '项目编号',width: 120,hide:true},		
        {fixed: 'right',width: 70,align: 'center',toolbar: '#barDemo'}]],
        id: 'u',
        limit: 10,
        page: true,
        height: 475
    });
	
    form.on('submit(u_add)', function(data){
		location.href = 'list_t4input.asp?now=' + new Date().getTime();
    });		
    form.on('submit(u_search)', function(data){
      var field = data.field;
      table.reload('u', {
        where: field
      });
        layer.msg('已刷新');	  
    });		
	
    table.on('tool(u)',
    function(obj) {
        var data = obj.data;
		if(obj.event === 't_show2'){
			location.href = 'list_t4input.asp?now=' + new Date().getTime()+"&id="+data.id+"&tn="+data.tn+"&sszid="+data.bh+"&prj_id="+data.prj_id+"&un="+data.un;
		}
	});		
  });
  </script>
</body>
</html>